CPP_SRC := src_cpp
PYTHON_SRC := src_py
all:
	@swig -c++ -python -o swig_target/main_wrap.cpp $(CPP_SRC)/main.i
	@g++ -fPIC -shared \
		$(CPP_SRC)/main.cpp \
		$(CPP_SRC)/help.cpp \
		$(CPP_SRC)/test.cpp \
		$(CPP_SRC)/sql.cpp \
		$(CPP_SRC)/interface.cpp \
		swig_target/main_wrap.cpp \
		-lsqlite3 -Wall -I/usr/local/include/python38 \
		-o swig_target/_maincpp.so
run:
	@python3 $(PYTHON_SRC)/qt.py
ui:
	@python3 -m PyQt5.uic.pyuic src_py/ui/login.ui -o src_py/login_ui.py
	@python3 -m PyQt5.uic.pyuic src_py/ui/main.ui -o src_py/main_ui.py
	@python3 -m PyQt5.uic.pyuic src_py/ui/main_ui1.ui -o src_py/main_ui1.py
	@python3 -m PyQt5.uic.pyuic src_py/ui/main_ui2.ui -o src_py/main_ui2.py
	@python3 -m PyQt5.uic.pyuic src_py/ui/main_ui3.ui -o src_py/main_ui3.py
clean:
	@rm -f swig_target/main_wrap.cpp swig_target/_maincpp.so swig_target/maincpp.py
# don't use local since it has not been tested
local:
	@g++ $(CPP_SRC)/main.cpp $(CPP_SRC)/help.cpp $(CPP_SRC)/test.cpp $(CPP_SRC)/sql.cpp -lsqlite3 -o $(CPP_SRC)/res -Wall -g